An elevator car is driven in an elevator hoistway with a hoisting machine. The moving force is transmitted from the hoisting machine to the elevator car and also to the counterweight through a traction rope traveling via a traction sheave of the hoisting machine. If the friction between the traction sheave and the traction rope is too low, the traction rope is able to slide on the traction sheave when accelerating or decelerating with the hoisting machine. If the friction is high, the traction rope is not able to slide on the traction sheave, even in a situation in which the counterweight or the elevator car grips the guide rail or some other structure of the elevator hoistway during a run with the elevator. In this case the elevator car/counterweight continues its progress when the traction sheave rotates owing to the high friction, although the traction rope on the other side of the traction sheave at the same time starts to slacken owing to the gripped counterweight/elevator car. Slackening of the traction rope might result in a dangerous situation, if the gripped counterweight/elevator car suddenly detaches and, owing to the slackening of the traction rope, is able to fall freely in the elevator hoistway. On the other hand, slackening of the traction rope can also result in the final loss of friction between the traction sheave and the traction rope, in which case the traction rope is able to slide uncontrollably on the traction sheave.